#继承
class Phone:
    IMEI = None
    producer = "HM"
    __list_id = None

    def call_4g(self):
        print("4g")


#单继承
class Phone2025(Phone):
    face_id = "10001"
    producer = "2025HM" #复写父类成员变量

    #复写
    def call_4g(self):
        print("2025_4G")

    def call_5g(self):
        print("5G")

    def function(self):
        #调用被重写的父类方法
        print(Phone.producer)
        Phone.call_4g(self)

        print(super().producer)
        super().call_4g()

#子类可以调用父类的非私有方法和属性
phone1 = Phone2025()
phone1.call_4g()


#多继承
class NFCReader:
    nfc_type = "第一代"
    producer = "ITCAST"

    def read_card(self):
        print("读卡")


class MyPhone(Phone,NFCReader):
    pass#表示这里为空，保证语法不报错

phone2 = MyPhone()
phone2.read_card()
phone2.call_4g()
#当继承的成员变量名相同时，优先调用先继承的类
print(phone2.producer)